package com.wendy.common.core.annotation;

import com.wendy.common.core.constant.RegexConstant;

import javax.validation.Payload;
import javax.validation.constraints.Pattern;
import java.lang.annotation.*;

/**
 * @author leqix
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Pattern(regexp = RegexConstant.ID_CARD_REGEX)
public @interface Idcard  {

    String  regexp() default RegexConstant.ID_CARD_REGEX;

    String  message() default "请输入正确的身份证号码";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
